import axios from "axios";

const request = axios.create({
  baseURL: "http://localhost:8081/",
  timeout: 5000,
});

request.interceptors.request.use((config) => {
    console.log("请求拦截器处理中");
    return config;
  });
  
  request.interceptors.response.use(
    (res) => {
      console.log("响应拦截器处理中");
      return res.data;
    },
    (error) => {
      console.log("响应拦截器异常");
      return Promise.reject(error);
    }
  );

export default request
